document.onreadystatechange = function () {
    if (document.readyState === "interactive") {
      let ul = document.querySelector("ul");
      let el = "";
      fetch("http://chst.vip:1234/api/getmoneyctrl")
        .then((body) => body.json())
        .then((res) => {
          res.result.forEach((item) => {
            let regExp = /(?<=imgurl=)[^'"]*/;
            let url = item.productImg2.match(regExp);
            el += ` <li id=${item.productId}>
          <img src="${url[0]}" alt="">
          <p>
          ${item.productName}
          <span>${item.productPinkage}</span>
          </p>
          <span>${item.productFrom}|${item.productTime}</span>
          <span>${item.productComCount}</span>
      </li>`;
          });
          ul.innerHTML = el;
        });
    }
  };
  let ul = document.querySelector("ul");
  ul.addEventListener(
    "click",
    function (e) {
      const arr = [...e.path].reverse();
      let _this = arr[5];
      let id = _this.getAttribute("id");
      let name = $(_this).find("p").text();
      location.href = "./pages/xq.html?id=" + id + "&name=" + name + "&age=22";
    },
    false
  );